<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="${pageContext.request.contextPath }/bootstrap/css/bootstrap.css" rel="stylesheet" type="text/css" />
<title>赛事申请表待审核列表</title>
</head>
<body>
<%@include file="../navigationBar.jsp"%>
	<div class="container">
		<div class="row" role="content">
			<div class="col-md-12">
				<table class="table table-striped">
					<caption>赛事申请表待审核列表</caption>
					<thead>
						<tr>
							<th>申请表id</th>
							<th>场地id</th>
							<th>申请人姓名</th>
							<th>申请人电话</th>
							<th>赛事名称</th>
							<th>赛事项目</th>
							<th>开始时间</th>
							<th>结束时间</th>
							<th>负责人</th>
							<th>审核状态</th>
							<th>操作</th>
						</tr>
					</thead>
					<tbody>
						<s:iterator value="list">
							<tr>
								<td><s:property value="matchApplyID" /></td>
								<td><s:property value="placeID" /></td>
								<td><s:property value="proposerName" /></td>
								<td><s:property value="proposerPhone" /></td>
								<td><s:property value="matchName" /></td>
								<td><s:property value="matchProject" /></td>
								<td><s:property value="startTime" /></td>
								<td><s:property value="endTime" /></td>
								<td><s:property value="personInCharge" /></td>
								<td><s:property value="auditStatus" /></td>
								<td><button class="btn btn-primary doPassed"
										data-toggle="modal" data-target="#mymodal">审核通过</button>
									<button class="btn btn-danger doFailed" data-toggle="modal"
										data-target="#mymodal">审核不通过</button></td>
							</tr>
						</s:iterator>
					</tbody>
				</table>

			</div>
		</div>
		<div class="row" role="pager">
			<div class="col-md-3 col-md-offset-6">
				<s:if test="currPage != 1">
					<a href="matchApply_examine.action?currPage=1">首页</a>
					<a href="matchApply_examine.action?currPage=<s:property value="currPage-1"/>">上一页</a>
				</s:if>
				<span>第<s:property value="currPage"/>/<s:property value="totalPage"/>页</span>
				<s:if test="currPage != totalPage">
					<a href="matchApply_examine.action?currPage=<s:property value="currPage+1"/>">下一页</a>
					<a href="matchApply_examine.action?currPage=<s:property value="totalPage"/>">尾页</a>
				</s:if>
			</div>
		</div>
	</div>
	<div class="modal fade" id="mymodal" aria-hidden="true">
		<div class="modal-dialog modal-sm">
			<div class="modal-content">
				<div class="modal-header">
					<button class="close" data-dismiss="modal">
						<span aria-hidden="true">&times;</span>
					</button>
					<h4 class="modal-title" id="confirmMsg"></h4>
				</div>
				<div class="modal-body">
					<s:form namespace="/" class="col-md-12 form form-horizontal" id="confirmForm">
						<div class="form-group">
							<label class="label label-info" for="matchApplyID">赛事申请表id</label>
							<input class="form-control " name="matchApplyID" type="text" id="matchApplyID" readonly>
							<label class="label label-info" for="placeID">场地ID</label>
							<input class="form-control" name="placeID" type="text" id="placeID" readonly>
							<label class="label label-info" for="proposerName">申请人姓名</label>
							<input class="form-control" name="proposerName" type="text" id="proposerName" readonly> 
							<label class="label label-info" for="proposerPhone">申请人电话</label>
							<input class="form-control" name="proposerPhone" type="text" id="proposerPhone" readonly>
							<label class="label label-info" for="matchName">赛事名称</label>
							<input class="form-control" name="matchName" type="text" id="matchName" readonly>
							<label class="label label-info" for="matchProject">赛事项目</label>
							<input class="form-control" name="matchProject" type="text" id="matchProject" readonly>
							<label class="label label-info" for="startTime">起始时间</label>
							<input class="form-control" name="startTime" type="text" id="startTime" readonly>
							<label class="label label-info" for="endTime">结束时间</label>
							<input class="form-control" name="endTime" type="text" id="endTime" readonly>
							<label class="label label-info" for="personInCharge">负责人</label>
							<input class="form-control" name="personInCharge" type="text" id="personInCharge" readonly>
							<label class="label label-info" for="auditStatus">审核状态</label>
							<input class="form-control" name="auditStatus" type="text" id="auditStatus" readonly>
						</div>
					</s:form>
				</div>
					<button class="btn btn-success" id="yes">确定</button>
					<button class="btn btn-default" data-dismiss="modal">取消</button>
			</div>
		</div>
	</div>
	
	<script type="text/javascript" src="${pageContext.request.contextPath }/bootstrap/js/jquery-3.2.0.js"></script>
	<script type="text/javascript" src="${pageContext.request.contextPath }/bootstrap/js/bootstrap.js"></script>
	<script type="text/javascript">
		$(".doPassed").click(function() {
			$("#confirmForm").attr("action", "matchApply_exPassed");
			$("#confirmMsg").text("确定审核通过吗");
			$(this).parent().siblings().each(function(index, element) {
				$("label + input").eq(index).val($(this).text());
			});
		});
		$(".doFailed").click(function() {
			$("#confirmForm").attr("action", "matchApply_exFailed");
			$("#confirmMsg").text("确定审核不通过吗");
			$(this).parent().siblings().each(function(index, element) {
				$("label + input").eq(index).val($(this).text());
			});
		});
		$("#yes").click(function() {
			$("#confirmForm").submit();
		});
	</script>
</body>
</html>